import { request } from "@/utils/http";
import { ReqHospitalAdd, ReqHospitalSetListParms, ReqHospitalSetListRequest, ReqUpdateHospital } from "./model/hospitalSetType";

// 获取医院设置数据
export function reqGetHospitalSetList({ page, limit, hoscode, hosname }: ReqHospitalSetListParms) {
    return request.get<any, ReqHospitalSetListRequest>(`/admin/hosp/hospitalSet/${page}/${limit}`, {
        params: {
            hoscode,
            hosname
        }

    })
}

// 添加医院数据
export function reqGetHospitalSetadd(obj: ReqHospitalAdd) {
    return request.post<any, null>("/admin/hosp/hospitalSet/save",
        obj

    )
}

// 修改医院数据获取默认值
export function getUpdateHospital(id: string) {
    return request.get<any,ReqHospitalSetListRequest>(`/admin/hosp/hospitalSet/get/${id}}`)
}
// update更新数据
export function updateHospital(obj:ReqUpdateHospital){
    return request.put<any,null>("/admin/hosp/hospitalSet/update",obj)

}
// 根据ID删除单个医院
export function delHospital(id:number){
    return request.delete<any,null>(`/admin/hosp/hospitalSet/remove/${id}`)
}
// 批量删除医院
export function delAllHospital(idList:React.Key[]){
    return request.delete("/admin/hosp/hospitalSet/batchRemove",{
        data:idList
        
    })
}